package com.awesome.javademo.threads.thread.create;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.awesome.javademo.R;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadCreateActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_thread_create);
        // 创建线程的方式
//        //第一种方式
//        MyThread myThread = new MyThread();
//        myThread.start();
//        //第二种方式
//        MyRunnable myRunnable = new MyRunnable();
//        Thread thread = new Thread(myRunnable);
//        thread.start();
//        //第三种方式


        // 线程异步执行
//        AsyncSyncThreadUtil.performAsync();
        // 同步异步执行
//        AsyncSyncThreadUtil.performSync();
    }
}